<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件</title>
    <script src="../build/react.min.js"></script>
    <script src="../build/react-dom.min.js"></script>
    <script src="../build/browser.min.js"></script>
    <style type="text/css">
        .font16{
            font-size: 16px;
            color: blue;
        }
    </style>
</head>
<body>
<div id="example"></div>
<!--所有组件类的第一个字母必须大写，否则会报错-->
<script type="text/babel">
    var HelloMessage = React.createClass({
        render: function () {
            return <div><h1>Hello {this.props.name}</h1><h2>you are {this.props.age}</h2></div>;
        }
    });
    ReactDOM.render(
            <HelloMessage className="font16" name="li" age="22" />,
            document.getElementById('example')
    );
</script>
</body>
</html>